package
{
	import com.ghost.manager.Js_manager;
	import com.ghost.model.Global_data;
	import com.ghost.model.Object_pool;
	import com.ghost.view.Loading.Loading_big_mc;
	
	import flash.display.Loader;
	import flash.display.Sprite;
	import flash.events.Event;
	import flash.events.ProgressEvent;
	import flash.net.URLRequest;

	[SWF(frameRate="30",width="1000",height="600",backgroundColor="0x000000")]
	public class First_load extends Sprite
	{
		private var ld:Loader;
		private var loading_big_mc:Loading_big_mc;
		public function First_load()
		{
			Global_data.Game_s = stage;
			Js_manager.getInstance().ori(Global_data.Game_s,1000,600,1440,900,1000,600);
			Object_pool.init();
			loading_big_mc = new Loading_big_mc();
			stage.addChild(loading_big_mc);
			loading_big_mc.x = 500-loading_big_mc.width/2;
			loading_big_mc.y = 300-loading_big_mc.height/2;
			ld = new Loader();
			ld.load(new URLRequest("architecture.swf"+"?"+String(Math.random()*100)));
			ld.contentLoaderInfo.addEventListener(Event.COMPLETE,cHandler);
			ld.contentLoaderInfo.addEventListener(ProgressEvent.PROGRESS,pro_Handler);
		}
		private function pro_Handler(e:ProgressEvent):void
		{
			loading_big_mc.show_change("主文件",Math.floor(e.bytesLoaded / e.bytesTotal * 100 ));
		}
		private function cHandler(e:Event):void
		{
			Global_data.Game_s.removeChild(loading_big_mc);
			loading_big_mc = null;
			Global_data.Game_s.addChild(ld);
		}
	}
}